package com.syni.mdd.sjb.community.base.auth;

import com.alibaba.fastjson.JSON;
import com.syni.mdd.sjb.common.component.mybatis.common.entity.DxshAppUserInfo;
import lombok.Data;

/**
 * @className AuthUserBo
 * @description TOO
 * @Author cfx
 * @DATE 2020/4/10 9:43
 * @VERSION 1.0
 **/
@Data
public class BackPcAuthUserBo {
    private Integer qxwxAdminId;
    private String qxyxUserid;
    private String corpid;
    //觅东东体系userId
    private Integer userId;
    //觅东东体系角色Id,1-C端用户，4-电享生活app用户
    private Integer roleId;
    private boolean isSkipRedisCheck = false;

    public BackPcAuthUserBo(Integer qxwxAdminId,String qxyxUserid,String corpid) {
        this.qxwxAdminId = qxwxAdminId;
        this.qxyxUserid = qxyxUserid;
        this.corpid = corpid;
    }

    public BackPcAuthUserBo(Integer qxwxAdminId, String qxyxUserid, String corpid, DxshAppUserInfo dxshAppUserInfo) {
        this.qxwxAdminId = qxwxAdminId;
        this.qxyxUserid = qxyxUserid;
        this.corpid = corpid;
        if(dxshAppUserInfo != null) {
            this.userId = dxshAppUserInfo.getUserId();
            this.roleId = dxshAppUserInfo.getRoleId();
        }
        this.isSkipRedisCheck = true;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
